//主从表tab选项卡标志位
var ABE868_Tab_Flag = -1;
//其他页面传到本页面参数
var ABE868_param = {};
//当前触发按钮
var ABE868_btn = "";
//上一次触发的按钮
var ABE868_prev_btn = "";

/*定义查询条件变量*/
/*declare query param begin*/

/*declare query param end*/

/*定义下拉框集合定义*/
/*declare select options begin*/

/*declare select options end*/

//主从表传递参数
function ABE868_param_set(){
	/*Main Subsuv Table Param Begin*/
	
	/*Main Subsuv Table Param end*/
}

//业务逻辑数据开始
function ABE868_b_control_biz_start(inputparam) {
	layer.close(ly_index);
	ABE868_param = inputparam;
	//主从表传递参数
	ABE868_param_set();	
    /*biz begin*/
	    ABE868_init_b_control()	
    /*biz end*/
}

/*业务函数步骤*/
/*biz step begin*/

/*biz step end*/

/*查找框函数*/
/*find qry fun begin*/

/*find qry fun end*/

/*页面结束*/
function ABE868_page_end(){
	//按钮权限控制
	page_btn_priv("ABE868");
}

//页面初始化
function ABE868_init_b_control() {
	//数据源配置2查询条件初始化设置
	/*query conditions init begin*/
	
    /*query conditions init end*/
	ABE868_page_end();
}

//清除冗余数据
$("#ABE868_del_truncate").click(function () {
    swal({
        title: "告警",
        text: "是否删除冗余数据",
        type: "warning",
        showCancelButton: true,
        confirmButtonColor: "#DD6B55",
        confirmButtonText: "确定",
        closeOnConfirm: false
    	},
        function () {
        ly_index = layer.load();
        var inputdata = {
        	"param_name": "T01_truncate_table",
        	"session_id": session_id,
        	"login_id": login_id
        };
        ly_index = layer.load();
        get_ajax_staticurl(inputdata, "ABE868_get_T01_truncate_table");
    });
});

//读取全局变量
$("#ABE868_get_initpage").click(function () {
    swal({
        title: "告警",
        text: "是否重新读取全局缓存信息",
        type: "warning",
        showCancelButton: true,
        confirmButtonColor: "#DD6B55",
        confirmButtonText: "确定",
        closeOnConfirm: false
    	},
        function () {
        ly_index = layer.load();
        var inputdata = {
        	"param_name": "init_page",
        	"session_id": session_id,
        	"login_id": login_id
        };
        ly_index = layer.load();
        get_ajax_staticurl(inputdata, "ABE868_get_tem_init_page");
    });
});

//文件内容替换
$("#ABE868_A01_REPSTR").click(function () {
	index_subhtml = "src_repstr.vue";
	if(loadHtmlSubVueFun("dev_vue/src_repstr.vue","ABE868_b_control_call_vue") == true){
		var n = Get_RandomDiv("AE9899","");
		layer.open({
			type: 1,
			area: ['1000px', '800px'],
			fixed: false, //不固定
			maxmin: true,
			content: $(n),
			success: function(layero, index){
				/*Send Two FindSelect param end*/
	        	var inputdata = {};	        	
	        	AE9899_src_repstr_biz_start(inputdata);
			},
			end: function(){
				$(n).hide();
			}
		});
	}
});

//“遍历源码并查找接口”按钮点击事件
$('#ABE868_A01_POROCU').click(function (){
	index_subhtml = "src_procused.vue";
	if(loadHtmlSubVueFun("dev_vue/src_procused.vue","ABE868_b_control_call_vue") == true){
		var n = Get_RandomDiv("A79D06","");
		layer.open({
			type: 1,
			area: ['1000px', '800px'],
			fixed: false, //不固定
			maxmin: true,
			content: $(n),
			success: function(layero, index){
				/*Send Two FindSelect param end*/
	        	var inputdata = {};	        	
	        	A79D06_src_procused_biz_start(inputdata);
			},
			end: function(){
				$(n).hide();
			}
		});
	}
});

//“测试按钮2”按钮点击事件
$('#ABE868_del_test2').click(function (){
	swal("“测试按钮2”按钮点击事件");
});

//操作结果
function ABE868_get_tem_init_page(input){
	layer.close(ly_index);
	//查询失败
    if (Call_OpeResult(input.init_page) == false)
        return false;  
}

//操作结果
function ABE868_get_T01_truncate_table(input) {
	layer.close(ly_index);
	//查询失败
    if (Call_OpeResult(input.T01_truncate_table) == false)
        return false;  
}

function ABE868_b_control_call_vue(objResult){
	if(index_subhtml == "src_repstr.vue")
	{
		var n = Get_RandomDiv("AE9899",objResult);	
		layer.open({
			type: 1,
	        area: ['1100px', '600px'],
	        fixed: false, //不固定
	        maxmin: true,
	        content: $(n),
	        success: function(layero, index){
	        	inputdata = {};
				/*查询条件参数传递至子页面,初次加载*/
				/*Send One FindSelect param bgein*/

				/*Send One FindSelect param end*/
				
	        	loadScript_hasparam("dev_vue/src_repstr.js","AE9899_src_repstr_biz_start",inputdata);
	        },
			end: function(){
				$(n).hide();
			}
	    });
	}
	else if(index_subhtml == "src_procused.vue")
	{
		var n = Get_RandomDiv("A79D06",objResult);	
		layer.open({
			type: 1,
	        area: ['1100px', '600px'],
	        fixed: false, //不固定
	        maxmin: true,
	        content: $(n),
	        success: function(layero, index){
	        	inputdata = {};
				/*查询条件参数传递至子页面,初次加载*/
				/*Send One FindSelect param bgein*/

				/*Send One FindSelect param end*/
				
	        	loadScript_hasparam("dev_vue/src_procused.js","A79D06_src_procused_biz_start",inputdata);
	        },
			end: function(){
				$(n).hide();
			}
	    });
	}
}

//测试按钮1
$("#ABE868_del_test1").click(function () {
	AD1D02_open_to_url3("mb_index.html","","{}");
});

//3：浏览器tab页
function AD1D02_open_to_url3(temindex_subhtml,temrandom_subhtml,temparam){
	AD1D02_btn = "";
	AD1D02_prev_btn = "";
	index_subhtml = s_decode(temindex_subhtml);
	inputrandom = s_decode(temrandom_subhtml);
	
	temsrcparam = JSON.parse(s_decode(temparam));
	var vparam = "";
	//单行选择
	var rowData = "";
	//多行选择
	var rowDatas = "";
	if(rowDatas.length > 0){
		$.each(rowDatas, function (i, obj) {
			for(var i = 0; i < temsrcparam.length; i ++){
				if(i != 0)
					vparam += "&"+temsrcparam[i]["TARGET_NAME"]+"="+obj[temsrcparam[i]["SOUR_NAME"]];
				else
					vparam = temsrcparam[i]["TARGET_NAME"]+"="+obj[temsrcparam[i]["SOUR_NAME"]];
			}
		});
	}
	else if(rowData != null){
		for(var i = 0; i < temsrcparam.length; i ++){
			if(i != 0)
				vparam += "&"+temsrcparam[i]["TARGET_NAME"]+"="+rowData[temsrcparam[i]["SOUR_NAME"]];
			else
				vparam = temsrcparam[i]["TARGET_NAME"]+"="+rowData[temsrcparam[i]["SOUR_NAME"]];
		}
	}
	if(vparam != "")
		window.open(index_subhtml+"?"+vparam,"_blank");
	else
		window.open(index_subhtml,"_blank");
}